package com.zhengshan.demo.unit.excel;


import cn.hutool.json.JSON;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.excel.EasyExcel;

import java.util.*;

/**
 * todo
 *
 * @author zhengshan
 * @Date 2023/10/19 15:33
 */
public class JSON2Excel {

    public static final String FILE_NAME = "3.xls";
    public static final String SHEET_NAME = "default";
    private final Map<Integer, Map<Integer, String>> pos = new HashMap<>();
    private int row = 0;

    public void test() {
        String json = getJsonStr();
            //转换json
            System.out.println(json);
            JSON obj = JSONUtil.parseObj(json);
            //记录所有键值坐标位置Map
            fillMap(obj, 0);
            //根据Map坐标转换为二维数组
            List<List<String>> exportList = buildExcelExportList(pos);
            //导出
            EasyExcel.write(1231111 + ".xls").sheet(SHEET_NAME).doWrite(exportList);
    }

    /**
     * Map递归记录
     */
    public void fillMap(Object obj, int depth) {
        int col = depth;
        if (obj instanceof JSONObject) {
            for (Map.Entry<String, Object> entry : ((JSONObject) obj)) {
                //记录键
                setPos(row, col, entry.getKey());
                row++;
                //下一层
                depth++;
                fillMap(entry.getValue(), depth);
                depth--;
            }
        } else if (obj instanceof JSONArray) {
            for (Object val : ((JSONArray) obj)) {
                //如果是数组里的普通的值,就下一行,避免覆盖。
                if (!(val instanceof JSON)) {
                    row++;
                }
                fillMap(val, depth);
            }
        } else {
            //把值填到key:val 的val里
            row--;
            setPos(row, col, Objects.toString(obj, ""));
            row++;
        }
    }

    /**
     * Map记录坐标
     */
    public void setPos(int row, int col, String val) {
        pos.computeIfAbsent(row, k -> new HashMap<>());
        pos.get(row).put(col, val);
    }

    /**
     * Map坐标转二维数组
     */
    public List<List<String>> buildExcelExportList(Map<Integer, Map<Integer, String>> posType) {
        int maxI = getMaxI(posType);
        int maxJ = getMaxJ(posType);
        List<List<String>> excelList = new ArrayList<>(maxI);
        for (int i = 0; i < maxI; i++) {
            List<String> columnList = new ArrayList<>(maxJ);
            for (int j = 0; j < maxJ; j++) {
                String val = null;
                if (posType.get(i) != null) {
                    val = posType.get(i).get(j);
                }
                columnList.add(j, val);
            }
            excelList.add(columnList);
        }
        return excelList;
    }

    /**
     * 获取行size
     */
    private Integer getMaxI(Map<Integer, Map<Integer, String>> m) {
        return m.keySet().stream().max(Comparator.naturalOrder()).get() + 1;
    }

    /**
     * 获取列size
     */
    private Integer getMaxJ(Map<Integer, Map<Integer, String>> m) {
        return m.values().stream().map(p -> p.keySet().stream().max(Comparator.naturalOrder()).get())
                .max(Comparator.naturalOrder()).get() + 1;
    }

    public String getJsonStr() {
        List<String> list = new ArrayList<>();
        list.add("{\"authorization\":\"f73ec4b00c034df0bd375a6a9f015f2e\",\"list\":[{\"e_commerce\":{\"jdeInternationalCode\":\"6973424781364\",\"jdeSize\":\"12*12\",\"jdeSalesRate\":\"0.13\",\"jdeValidity\":\"11\",\"isloseEfficacy\":\"N\",\"commerAccept\":\"12\",\"commerFranchiseInfo\":\"321\"},\"fifth_category\":{\"ITEM_JDE_CODE\":\"86130954\",\"CG_SUPERIOR_CODE\":\"N0601017\",\"CG_SUPERIOR_NAME\":\"纸袋_特殊\",\"CG_CODE\":\"N06010170001\",\"CG_LEVEL\":\"5\",\"CG_NAME\":\"通用10号褐牛纸袋\",\"CG_WHETHER_LOWEST_CATEGORY\":\"Y\"},\"p_items\":[],\"one_time_unpack\":[{\"DEV_INNER_PACKING_SUITABILITY\":null,\"DEV_REASION\":null,\"DEV_ITEM_ATTRIBUTES\":null,\"DEV_DELIVERY_UNIT\":null,\"DEV_ITEM_NAME\":null,\"DEV_INNER_PACKING_DESC\":null,\"ITEM_JDE_CODE\":\"86130954\",\"DEV_WEHTHER_PUBLIC_ITEM_BRAND\":null,\"DEV_SELF_LIFE\":null,\"DEV_INNER_PACKING_SPEC\":null,\"DEV_SINGLEBOX_USED_DAYS\":null,\"DEV_PUR_PRICE\":null,\"DEV_BRANDS_RESTAURANTS\":null}],\"basic\":{\"GOODS_CLASSIFICATION_NAME\":\"03-包装品\",\"THIRD_LEVEL_FROM_UNIT\":null,\"LOWEST_CATEGORY_CODE\":\"N06010170001\",\"MEASURED_GROSS_WEIGHT_UNIT\":\"CA\",\"HEC_SHELF_LIFE_PRE_WARNING\":null,\"WHETHER_HAVE_EQA_CODE\":\"Y\",\"SIXTH_LEVEL_TO_UNIT\":\"GM\",\"LS_SALES_CATEGORY_CODE_ONE\":null,\"EXTENSION\":\"KFC 2016七月版\",\"FIXED_ASSETS_SERVICE_LIFE\":null,\"FIXED_ASSETS_PUR_PRICE\":null,\"MEASURED_CUBIC_UNIT\":\"CA\",\"WHETHER_IP_ITEM\":null,\"BUYER_GROUP\":\"9400115\",\"SIXTH_LEVEL_CONVERSION_RATIO\":13.2000000,\"GENERAL_LEDGER_LEVEL\":\"IN20\",\"ITEM_TEMPLATE\":\"M_PCM_PACKAGING\",\"RESTAURANT_DELIVERY_UNIT\":\"CA\",\"FIT_CODE\":\"P0000436\",\"ITEM_JDE_CODE\":\"86131351\",\"MEASURED_CUBIC\":13.2000000,\"FIT_MATERIAL_UNIT\":\"E9\",\"DEVANNING_CONVERSION_RATIO_NEW\":1000.0000000,\"LPS_CODE\":null,\"HEC_FORWARDING_VENDOR_CODE\":null,\"WHETHER_PRICE_SYNCHRONIZES_MAS\":\"N\",\"FOURTH_LEVEL_TO_UNIT\":null,\"MAIN_MEASURING_UNIT\":\"E9\",\"WHETHER_ONETIME_DEVANNING\":\"N\",\"DEVANNING_CONVERSION_RATIO\":null,\"HEC_WHETHER_YUMC_ELEMENT\":null,\"ITEM_LAST_UPDATE_DATE\":\"2022-05-17 14:25:17\",\"WHETHER_SYNCHRONIZE_EP\":\"Y\",\"SALES_CATEGORY_CODE_FOUR\":\"A\",\"MODEL_ITEM\":null,\"DEPARTMENT\":\"PCM\",\"SALES_CATEGORY_CODE_FOUR_NAME\":\"A-干货\",\"LS_RECEIPT_INSPECTION\":null,\"GOODS_CLASSIFICATION\":\"03\",\"BUSINESS_BRAND_OWNERSHIP\":\"KFC\",\"LS_AP\":null,\"ITEM_NAME_IN_CHINESE\":\"10# 褐牛纸袋_KFC 2016七月版-250只*4袋/箱\",\"FOURTH_LEVEL_CONVERSION_RATIO\":null,\"GOODS_SUBCLASS\":\"303\",\"FIFTH_LEVEL_FROM_UNIT\":\"E9\",\"GOODS_SUBCLASS_NAME\":\"303-袋子类\",\"FOURTH_LEVEL_FROM_UNIT\":null,\"FIFTH_LEVEL_TO_UNIT\":\"CC\",\"QUOTING_UNIT\":\"CA\",\"PUR_MEASURING_UNIT\":\"CA\",\"ITEM_NAME_IN_ENGLISH\":null,\"PACKING_SPECIFICATION\":\"250只*4袋*1箱\",\"THIRD_LEVEL_TO_UNIT\":null,\"SECOND_LEVEL_FROM_UNIT\":\"BC\",\"GENERAL_LEDGER_CATEGORY_CODE\":\"KFC\",\"FIRST_LEVEL_TO_UNIT\":\"BC\",\"STATUS_IN_BOM\":\"ACTIVE\",\"SHORT_PROJECT_NUMBER\":\"86047929\",\"HEC_SHELF_LIFE_BANNED_SALE\":null,\"FIRST_LEVEL_CONVERSION_RATIO\":4.0000000,\"ITEM_CREATED_BY\":\"ADMIN(期初导入)\",\"ITEM_CATEGORY\":\"Z\",\"SECOND_LEVEL_CONVERSION_RATIO\":250.0000000,\"HEC_YUM_LOWEST_AP\":null,\"WHETHER_HAVE_AP_TABLE\":\"Y\",\"DEVANNING_FROM_UNIT\":null,\"FIFTH_LEVEL_CONVERSION_RATIO\":52.5600000,\"SIXTH_LEVEL_FROM_UNIT\":\"E9\",\"DEVANNING_TO_UNIT_NEW\":\"E9\",\"REGULAR_EDITION_EFFECTIVE_DATE\":null,\"ITEM_LAST_UPDATED_BY\":\"管理员\",\"P_BRAND_CODE\":null,\"SECOND_LEVEL_TO_UNIT\":\"E9\",\"LS_DELIVERY_METHOD\":null,\"MASTER_PLANNER\":\"-\",\"JDE_ITEM_NAME\":\"10# 褐牛纸袋_KFC 2016七月版-250只*4袋/箱\",\"WHETHER_REGULAR_EDITION\":\"N\",\"HEC_BAR_CODE\":null,\"WHETHER_LONGTIME_DEVANNING\":\"N\",\"HEC_SHELF_LIFE\":null,\"LC_SHELF_LIFE\":null,\"BRAND_NAME\":null,\"FIRST_LEVEL_FROM_UNIT\":\"CA\",\"ITEM_CREATION_DATE\":\"2016-03-23 00:00:00\",\"STATE_TAX_COMMODITY_CODE\":\"1060105010000000000\",\"WHETHER_FRAGILE\":null,\"DEVANNING_FROM_UNIT_NEW\":\"CA\",\"JDE_RELATED_EQA_CODE\":\"SKU0001843\",\"THIRD_LEVEL_CONVERSION_RATIO\":null,\"MEASURED_GROSS_WEIGHT\":13.2000000,\"JDE_RELATED_EQA_SUBCODE\":\"SKU0004743-1\",\"DEVANNING_TO_UNIT\":null},\"brand\":[{\"ITEM_JDE_CODE\":\"86131351\",\"BRAND_CODE\":\"KFC\",\"BRAND_STATUS\":\"FROZEN\"}],\"acceptable_period\":{\"AP_BRAND_CODE\":\"KFC\",\"AP_DELIVERY_UNIT\":\"CA\",\"AP_PACKING_SPEC\":\"250只*4袋*1箱\",\"AP_RESTAURANT\":30,\"AP_OPERABILITY\":\"Y\",\"AP_YLC_PRINCIPAL\":null,\"AP_JDE_PRODUCT_NAME\":\"通用10号褐牛纸袋\",\"AP_LC_ALLOCATION\":15,\"AP_SHELF_LIFE\":730,\"AP_INTEGRATION_CENTER\":15,\"AP_VENDOR_TURNOVER_DAYS\":365,\"AP_LC_DELIVERY_DAYS\":9,\"ITEM_JDE_CODE\":\"86130954\",\"AP_LC_INVENTORY_DAYS\":30,\"AP_RE_PRINCIPAL\":null,\"AP_LC_REMAINING_ADJUSTABLE_DAYS\":266,\"AP_ATTRIBUTES\":\"A\",\"AP_LC\":365,\"AP_SCM_PRINCIPAL\":null,\"AP_YUM\":365},\"promotion\":{\"PROMOTION_MKT_COUNTERPART\":null,\"PROMOTION_REMARKS\":null,\"IP_AUTHORIZATION_END_DATE\":null,\"ITEM_JDE_CODE\":\"86130954\",\"PROMOTION_END_DATE\":null,\"BRAND_CODE\":null,\"PROMOTION_START_DATE\":null,\"PROMOTION_OFFICIAL_NAME\":null,\"PROMOTION_MKT_APPLICANT\":null,\"PROMOTION_NATURE\":null,\"PROMOTION_MKT_MAIL\":null,\"JDE_ITEM_NAME\":\"通用10号褐牛纸袋-250只*4袋/箱\"}}]}");
        list.add("{\"authorization\":\"f73ec4b00c034df0bd375a6a9f015f2e\",\"list\":[{\"e_commerce\":{\"jdeInternationalCode\":\"6973424781364\",\"jdeSize\":\"12*12\",\"jdeSalesRate\":\"0.13\",\"jdeValidity\":\"11\",\"isloseEfficacy\":\"N\",\"commerAccept\":\"12\",\"commerFranchiseInfo\":\"321\"},\"fifth_category\":{\"ITEM_JDE_CODE\":\"86130954\",\"CG_SUPERIOR_CODE\":\"N0601017\",\"CG_SUPERIOR_NAME\":\"纸袋_特殊\",\"CG_CODE\":\"N06010170001\",\"CG_LEVEL\":\"5\",\"CG_NAME\":\"通用10号褐牛纸袋\",\"CG_WHETHER_LOWEST_CATEGORY\":\"Y\"},\"p_items\":[],\"one_time_unpack\":[{\"DEV_INNER_PACKING_SUITABILITY\":null,\"DEV_REASION\":null,\"DEV_ITEM_ATTRIBUTES\":null,\"DEV_DELIVERY_UNIT\":null,\"DEV_ITEM_NAME\":null,\"DEV_INNER_PACKING_DESC\":null,\"ITEM_JDE_CODE\":\"86130954\",\"DEV_WEHTHER_PUBLIC_ITEM_BRAND\":null,\"DEV_SELF_LIFE\":null,\"DEV_INNER_PACKING_SPEC\":null,\"DEV_SINGLEBOX_USED_DAYS\":null,\"DEV_PUR_PRICE\":null,\"DEV_BRANDS_RESTAURANTS\":null}],\"basic\":{\"GOODS_CLASSIFICATION_NAME\":\"03-包装品\",\"THIRD_LEVEL_FROM_UNIT\":null,\"LOWEST_CATEGORY_CODE\":\"N06010170001\",\"MEASURED_GROSS_WEIGHT_UNIT\":\"CA\",\"HEC_SHELF_LIFE_PRE_WARNING\":null,\"WHETHER_HAVE_EQA_CODE\":\"Y\",\"SIXTH_LEVEL_TO_UNIT\":\"GM\",\"LS_SALES_CATEGORY_CODE_ONE\":null,\"EXTENSION\":\".\",\"FIXED_ASSETS_SERVICE_LIFE\":null,\"FIXED_ASSETS_PUR_PRICE\":null,\"MEASURED_CUBIC_UNIT\":\"CA\",\"WHETHER_IP_ITEM\":null,\"BUYER_GROUP\":\"9400115\",\"SIXTH_LEVEL_CONVERSION_RATIO\":13.2000000,\"GENERAL_LEDGER_LEVEL\":\"IN20\",\"ITEM_TEMPLATE\":\"M_PCM_PACKAGING\",\"RESTAURANT_DELIVERY_UNIT\":\"CA\",\"FIT_CODE\":\"P0000436\",\"ITEM_JDE_CODE\":\"86131069\",\"MEASURED_CUBIC\":13.2000000,\"FIT_MATERIAL_UNIT\":\"E9\",\"DEVANNING_CONVERSION_RATIO_NEW\":1000.0000000,\"LPS_CODE\":null,\"HEC_FORWARDING_VENDOR_CODE\":null,\"WHETHER_PRICE_SYNCHRONIZES_MAS\":\"N\",\"FOURTH_LEVEL_TO_UNIT\":null,\"MAIN_MEASURING_UNIT\":\"E9\",\"WHETHER_ONETIME_DEVANNING\":\"N\",\"DEVANNING_CONVERSION_RATIO\":null,\"HEC_WHETHER_YUMC_ELEMENT\":null,\"ITEM_LAST_UPDATE_DATE\":\"2022-05-17 14:25:17\",\"WHETHER_SYNCHRONIZE_EP\":\"Y\",\"SALES_CATEGORY_CODE_FOUR\":\"A\",\"MODEL_ITEM\":null,\"DEPARTMENT\":\"PCM\",\"SALES_CATEGORY_CODE_FOUR_NAME\":\"A-干货\",\"LS_RECEIPT_INSPECTION\":null,\"GOODS_CLASSIFICATION\":\"03\",\"BUSINESS_BRAND_OWNERSHIP\":\"KFC\",\"LS_AP\":null,\"ITEM_NAME_IN_CHINESE\":\"2014版 10#褐牛纸袋-250只*4袋/箱\",\"FOURTH_LEVEL_CONVERSION_RATIO\":null,\"GOODS_SUBCLASS\":\"303\",\"FIFTH_LEVEL_FROM_UNIT\":\"E9\",\"GOODS_SUBCLASS_NAME\":\"303-袋子类\",\"FOURTH_LEVEL_FROM_UNIT\":null,\"FIFTH_LEVEL_TO_UNIT\":\"CC\",\"QUOTING_UNIT\":\"CA\",\"PUR_MEASURING_UNIT\":\"CA\",\"ITEM_NAME_IN_ENGLISH\":null,\"PACKING_SPECIFICATION\":\"250只*4袋*1箱\",\"THIRD_LEVEL_TO_UNIT\":null,\"SECOND_LEVEL_FROM_UNIT\":\"BC\",\"GENERAL_LEDGER_CATEGORY_CODE\":\"KFC\",\"FIRST_LEVEL_TO_UNIT\":\"BC\",\"STATUS_IN_BOM\":\"ACTIVE\",\"SHORT_PROJECT_NUMBER\":\"86041426\",\"HEC_SHELF_LIFE_BANNED_SALE\":null,\"FIRST_LEVEL_CONVERSION_RATIO\":4.0000000,\"ITEM_CREATED_BY\":\"ADMIN(期初导入)\",\"ITEM_CATEGORY\":\"Z\",\"SECOND_LEVEL_CONVERSION_RATIO\":250.0000000,\"HEC_YUM_LOWEST_AP\":null,\"WHETHER_HAVE_AP_TABLE\":\"Y\",\"DEVANNING_FROM_UNIT\":null,\"FIFTH_LEVEL_CONVERSION_RATIO\":52.5600000,\"SIXTH_LEVEL_FROM_UNIT\":\"E9\",\"DEVANNING_TO_UNIT_NEW\":\"E9\",\"REGULAR_EDITION_EFFECTIVE_DATE\":null,\"ITEM_LAST_UPDATED_BY\":\"管理员\",\"P_BRAND_CODE\":null,\"SECOND_LEVEL_TO_UNIT\":\"E9\",\"LS_DELIVERY_METHOD\":null,\"MASTER_PLANNER\":\"-\",\"JDE_ITEM_NAME\":\"2014版 10#褐牛纸袋-250只*4袋/箱\",\"WHETHER_REGULAR_EDITION\":\"N\",\"HEC_BAR_CODE\":null,\"WHETHER_LONGTIME_DEVANNING\":\"N\",\"HEC_SHELF_LIFE\":null,\"LC_SHELF_LIFE\":null,\"BRAND_NAME\":null,\"FIRST_LEVEL_FROM_UNIT\":\"CA\",\"ITEM_CREATION_DATE\":\"2013-11-28 00:00:00\",\"STATE_TAX_COMMODITY_CODE\":\"1060105010000000000\",\"WHETHER_FRAGILE\":null,\"DEVANNING_FROM_UNIT_NEW\":\"CA\",\"JDE_RELATED_EQA_CODE\":\"SKU0001843\",\"THIRD_LEVEL_CONVERSION_RATIO\":null,\"MEASURED_GROSS_WEIGHT\":13.2000000,\"JDE_RELATED_EQA_SUBCODE\":\"SKU0001203-1\",\"DEVANNING_TO_UNIT\":null},\"brand\":[{\"ITEM_JDE_CODE\":\"86131069\",\"BRAND_CODE\":\"KFC\",\"BRAND_STATUS\":\"ACTIVE\"},{\"ITEM_JDE_CODE\":\"86131069\",\"BRAND_CODE\":\"ED\",\"BRAND_STATUS\":\"ACTIVE\"}],\"acceptable_period\":{\"AP_BRAND_CODE\":\"KFC\",\"AP_DELIVERY_UNIT\":\"CA\",\"AP_PACKING_SPEC\":\"250只*4袋*1箱\",\"AP_RESTAURANT\":30,\"AP_OPERABILITY\":\"Y\",\"AP_YLC_PRINCIPAL\":null,\"AP_JDE_PRODUCT_NAME\":\"通用10号褐牛纸袋\",\"AP_LC_ALLOCATION\":15,\"AP_SHELF_LIFE\":730,\"AP_INTEGRATION_CENTER\":15,\"AP_VENDOR_TURNOVER_DAYS\":365,\"AP_LC_DELIVERY_DAYS\":9,\"ITEM_JDE_CODE\":\"86130954\",\"AP_LC_INVENTORY_DAYS\":30,\"AP_RE_PRINCIPAL\":null,\"AP_LC_REMAINING_ADJUSTABLE_DAYS\":266,\"AP_ATTRIBUTES\":\"A\",\"AP_LC\":365,\"AP_SCM_PRINCIPAL\":null,\"AP_YUM\":365},\"promotion\":{\"PROMOTION_MKT_COUNTERPART\":null,\"PROMOTION_REMARKS\":null,\"IP_AUTHORIZATION_END_DATE\":null,\"ITEM_JDE_CODE\":\"86130954\",\"PROMOTION_END_DATE\":null,\"BRAND_CODE\":null,\"PROMOTION_START_DATE\":null,\"PROMOTION_OFFICIAL_NAME\":null,\"PROMOTION_MKT_APPLICANT\":null,\"PROMOTION_NATURE\":null,\"PROMOTION_MKT_MAIL\":null,\"JDE_ITEM_NAME\":\"通用10号褐牛纸袋-250只*4袋/箱\"}}]}");
        list.add("{\"authorization\":\"f73ec4b00c034df0bd375a6a9f015f2e\",\"list\":[{\"e_commerce\":{\"jdeInternationalCode\":\"6973424781364\",\"jdeSize\":\"12*12\",\"jdeSalesRate\":\"0.13\",\"jdeValidity\":\"11\",\"isloseEfficacy\":\"N\",\"commerAccept\":\"12\",\"commerFranchiseInfo\":\"321\"},\"fifth_category\":{\"ITEM_JDE_CODE\":\"86130954\",\"CG_SUPERIOR_CODE\":\"N0601017\",\"CG_SUPERIOR_NAME\":\"纸袋_特殊\",\"CG_CODE\":\"N06010170001\",\"CG_LEVEL\":\"5\",\"CG_NAME\":\"通用10号褐牛纸袋\",\"CG_WHETHER_LOWEST_CATEGORY\":\"Y\"},\"p_items\":[],\"one_time_unpack\":[{\"DEV_INNER_PACKING_SUITABILITY\":null,\"DEV_REASION\":null,\"DEV_ITEM_ATTRIBUTES\":null,\"DEV_DELIVERY_UNIT\":null,\"DEV_ITEM_NAME\":null,\"DEV_INNER_PACKING_DESC\":null,\"ITEM_JDE_CODE\":\"86130954\",\"DEV_WEHTHER_PUBLIC_ITEM_BRAND\":null,\"DEV_SELF_LIFE\":null,\"DEV_INNER_PACKING_SPEC\":null,\"DEV_SINGLEBOX_USED_DAYS\":null,\"DEV_PUR_PRICE\":null,\"DEV_BRANDS_RESTAURANTS\":null}],\"basic\":{\"GOODS_CLASSIFICATION_NAME\":\"03-包装品\",\"THIRD_LEVEL_FROM_UNIT\":null,\"LOWEST_CATEGORY_CODE\":\"N06010170001\",\"MEASURED_GROSS_WEIGHT_UNIT\":\"CA\",\"HEC_SHELF_LIFE_PRE_WARNING\":null,\"WHETHER_HAVE_EQA_CODE\":\"Y\",\"SIXTH_LEVEL_TO_UNIT\":\"GM\",\"LS_SALES_CATEGORY_CODE_ONE\":null,\"EXTENSION\":\".\",\"FIXED_ASSETS_SERVICE_LIFE\":null,\"FIXED_ASSETS_PUR_PRICE\":null,\"MEASURED_CUBIC_UNIT\":\"CA\",\"WHETHER_IP_ITEM\":null,\"BUYER_GROUP\":\"9400115\",\"SIXTH_LEVEL_CONVERSION_RATIO\":13.2000000,\"GENERAL_LEDGER_LEVEL\":\"IN20\",\"ITEM_TEMPLATE\":\"M_PCM_PACKAGING\",\"RESTAURANT_DELIVERY_UNIT\":\"CA\",\"FIT_CODE\":\"P0000436\",\"ITEM_JDE_CODE\":\"86130645\",\"MEASURED_CUBIC\":13.2000000,\"FIT_MATERIAL_UNIT\":\"E9\",\"DEVANNING_CONVERSION_RATIO_NEW\":1000.0000000,\"LPS_CODE\":null,\"HEC_FORWARDING_VENDOR_CODE\":null,\"WHETHER_PRICE_SYNCHRONIZES_MAS\":\"N\",\"FOURTH_LEVEL_TO_UNIT\":null,\"MAIN_MEASURING_UNIT\":\"E9\",\"WHETHER_ONETIME_DEVANNING\":\"N\",\"DEVANNING_CONVERSION_RATIO\":null,\"HEC_WHETHER_YUMC_ELEMENT\":null,\"ITEM_LAST_UPDATE_DATE\":\"2022-05-17 14:25:17\",\"WHETHER_SYNCHRONIZE_EP\":\"Y\",\"SALES_CATEGORY_CODE_FOUR\":\"A\",\"MODEL_ITEM\":null,\"DEPARTMENT\":\"PCM\",\"SALES_CATEGORY_CODE_FOUR_NAME\":\"A-干货\",\"LS_RECEIPT_INSPECTION\":null,\"GOODS_CLASSIFICATION\":\"03\",\"BUSINESS_BRAND_OWNERSHIP\":\"KFC\",\"LS_AP\":null,\"ITEM_NAME_IN_CHINESE\":\"10号纸袋(加印刷)-250只*4袋/箱\",\"FOURTH_LEVEL_CONVERSION_RATIO\":null,\"GOODS_SUBCLASS\":\"303\",\"FIFTH_LEVEL_FROM_UNIT\":\"E9\",\"GOODS_SUBCLASS_NAME\":\"303-袋子类\",\"FOURTH_LEVEL_FROM_UNIT\":null,\"FIFTH_LEVEL_TO_UNIT\":\"CC\",\"QUOTING_UNIT\":\"CA\",\"PUR_MEASURING_UNIT\":\"CA\",\"ITEM_NAME_IN_ENGLISH\":null,\"PACKING_SPECIFICATION\":\"250只*4袋*1箱\",\"THIRD_LEVEL_TO_UNIT\":null,\"SECOND_LEVEL_FROM_UNIT\":\"BC\",\"GENERAL_LEDGER_CATEGORY_CODE\":\"KFC\",\"FIRST_LEVEL_TO_UNIT\":\"BC\",\"STATUS_IN_BOM\":\"ACTIVE\",\"SHORT_PROJECT_NUMBER\":\"86019842\",\"HEC_SHELF_LIFE_BANNED_SALE\":null,\"FIRST_LEVEL_CONVERSION_RATIO\":4.0000000,\"ITEM_CREATED_BY\":\"ADMIN(期初导入)\",\"ITEM_CATEGORY\":\"Z\",\"SECOND_LEVEL_CONVERSION_RATIO\":250.0000000,\"HEC_YUM_LOWEST_AP\":null,\"WHETHER_HAVE_AP_TABLE\":\"Y\",\"DEVANNING_FROM_UNIT\":null,\"FIFTH_LEVEL_CONVERSION_RATIO\":52.5600000,\"SIXTH_LEVEL_FROM_UNIT\":\"E9\",\"DEVANNING_TO_UNIT_NEW\":\"E9\",\"REGULAR_EDITION_EFFECTIVE_DATE\":null,\"ITEM_LAST_UPDATED_BY\":\"管理员\",\"P_BRAND_CODE\":null,\"SECOND_LEVEL_TO_UNIT\":\"E9\",\"LS_DELIVERY_METHOD\":null,\"MASTER_PLANNER\":\"-\",\"JDE_ITEM_NAME\":\"10号纸袋(加印刷)-250只*4袋/箱\",\"WHETHER_REGULAR_EDITION\":\"N\",\"HEC_BAR_CODE\":null,\"WHETHER_LONGTIME_DEVANNING\":\"N\",\"HEC_SHELF_LIFE\":null,\"LC_SHELF_LIFE\":null,\"BRAND_NAME\":null,\"FIRST_LEVEL_FROM_UNIT\":\"CA\",\"ITEM_CREATION_DATE\":\"2008-02-22 00:00:00\",\"STATE_TAX_COMMODITY_CODE\":\"1060105010000000000\",\"WHETHER_FRAGILE\":null,\"DEVANNING_FROM_UNIT_NEW\":\"CA\",\"JDE_RELATED_EQA_CODE\":\"SKU0001843\",\"THIRD_LEVEL_CONVERSION_RATIO\":null,\"MEASURED_GROSS_WEIGHT\":13.2000000,\"JDE_RELATED_EQA_SUBCODE\":\"SKU0001089-1\",\"DEVANNING_TO_UNIT\":null},\"brand\":[{\"ITEM_JDE_CODE\":\"86130645\",\"BRAND_CODE\":\"KFC\",\"BRAND_STATUS\":\"FROZEN\"}],\"acceptable_period\":{\"AP_BRAND_CODE\":\"KFC\",\"AP_DELIVERY_UNIT\":\"CA\",\"AP_PACKING_SPEC\":\"250只*4袋*1箱\",\"AP_RESTAURANT\":30,\"AP_OPERABILITY\":\"Y\",\"AP_YLC_PRINCIPAL\":null,\"AP_JDE_PRODUCT_NAME\":\"通用10号褐牛纸袋\",\"AP_LC_ALLOCATION\":15,\"AP_SHELF_LIFE\":730,\"AP_INTEGRATION_CENTER\":15,\"AP_VENDOR_TURNOVER_DAYS\":365,\"AP_LC_DELIVERY_DAYS\":9,\"ITEM_JDE_CODE\":\"86130954\",\"AP_LC_INVENTORY_DAYS\":30,\"AP_RE_PRINCIPAL\":null,\"AP_LC_REMAINING_ADJUSTABLE_DAYS\":266,\"AP_ATTRIBUTES\":\"A\",\"AP_LC\":365,\"AP_SCM_PRINCIPAL\":null,\"AP_YUM\":365},\"promotion\":{\"PROMOTION_MKT_COUNTERPART\":null,\"PROMOTION_REMARKS\":null,\"IP_AUTHORIZATION_END_DATE\":null,\"ITEM_JDE_CODE\":\"86130954\",\"PROMOTION_END_DATE\":null,\"BRAND_CODE\":null,\"PROMOTION_START_DATE\":null,\"PROMOTION_OFFICIAL_NAME\":null,\"PROMOTION_MKT_APPLICANT\":null,\"PROMOTION_NATURE\":null,\"PROMOTION_MKT_MAIL\":null,\"JDE_ITEM_NAME\":\"通用10号褐牛纸袋-250只*4袋/箱\"}}]}");
        list.add("{\"authorization\":\"f73ec4b00c034df0bd375a6a9f015f2e\",\"list\":[{\"e_commerce\":{\"jdeInternationalCode\":\"6973424781364\",\"jdeSize\":\"12*12\",\"jdeSalesRate\":\"0.13\",\"jdeValidity\":\"11\",\"isloseEfficacy\":\"N\",\"commerAccept\":\"12\",\"commerFranchiseInfo\":\"321\"},\"fifth_category\":{\"ITEM_JDE_CODE\":\"86130954\",\"CG_SUPERIOR_CODE\":\"N0601017\",\"CG_SUPERIOR_NAME\":\"纸袋_特殊\",\"CG_CODE\":\"N06010170001\",\"CG_LEVEL\":\"5\",\"CG_NAME\":\"通用10号褐牛纸袋\",\"CG_WHETHER_LOWEST_CATEGORY\":\"Y\"},\"p_items\":[],\"one_time_unpack\":[{\"DEV_INNER_PACKING_SUITABILITY\":null,\"DEV_REASION\":null,\"DEV_ITEM_ATTRIBUTES\":null,\"DEV_DELIVERY_UNIT\":null,\"DEV_ITEM_NAME\":null,\"DEV_INNER_PACKING_DESC\":null,\"ITEM_JDE_CODE\":\"86130954\",\"DEV_WEHTHER_PUBLIC_ITEM_BRAND\":null,\"DEV_SELF_LIFE\":null,\"DEV_INNER_PACKING_SPEC\":null,\"DEV_SINGLEBOX_USED_DAYS\":null,\"DEV_PUR_PRICE\":null,\"DEV_BRANDS_RESTAURANTS\":null}],\"basic\":{\"GOODS_CLASSIFICATION_NAME\":\"03-包装品\",\"THIRD_LEVEL_FROM_UNIT\":null,\"LOWEST_CATEGORY_CODE\":\"N06010170001\",\"MEASURED_GROSS_WEIGHT_UNIT\":\"CA\",\"HEC_SHELF_LIFE_PRE_WARNING\":null,\"WHETHER_HAVE_EQA_CODE\":\"Y\",\"SIXTH_LEVEL_TO_UNIT\":\"GM\",\"LS_SALES_CATEGORY_CODE_ONE\":null,\"EXTENSION\":\"\",\"FIXED_ASSETS_SERVICE_LIFE\":null,\"FIXED_ASSETS_PUR_PRICE\":null,\"MEASURED_CUBIC_UNIT\":\"CA\",\"WHETHER_IP_ITEM\":null,\"BUYER_GROUP\":\"9400115\",\"SIXTH_LEVEL_CONVERSION_RATIO\":13.2000000,\"GENERAL_LEDGER_LEVEL\":\"IN20\",\"ITEM_TEMPLATE\":\"M_PCM_PACKAGING\",\"RESTAURANT_DELIVERY_UNIT\":\"CA\",\"FIT_CODE\":\"P0000436\",\"ITEM_JDE_CODE\":\"86130954\",\"MEASURED_CUBIC\":13.2000000,\"FIT_MATERIAL_UNIT\":\"E9\",\"DEVANNING_CONVERSION_RATIO_NEW\":1000.0000000,\"LPS_CODE\":null,\"HEC_FORWARDING_VENDOR_CODE\":null,\"WHETHER_PRICE_SYNCHRONIZES_MAS\":\"N\",\"FOURTH_LEVEL_TO_UNIT\":null,\"MAIN_MEASURING_UNIT\":\"E9\",\"WHETHER_ONETIME_DEVANNING\":\"N\",\"DEVANNING_CONVERSION_RATIO\":null,\"HEC_WHETHER_YUMC_ELEMENT\":null,\"ITEM_LAST_UPDATE_DATE\":\"2022-05-17 14:25:17\",\"WHETHER_SYNCHRONIZE_EP\":\"Y\",\"SALES_CATEGORY_CODE_FOUR\":\"A\",\"MODEL_ITEM\":\"86131351\",\"DEPARTMENT\":\"PCM\",\"SALES_CATEGORY_CODE_FOUR_NAME\":\"A-干货\",\"LS_RECEIPT_INSPECTION\":null,\"GOODS_CLASSIFICATION\":\"03\",\"BUSINESS_BRAND_OWNERSHIP\":\"KFC\",\"LS_AP\":null,\"ITEM_NAME_IN_CHINESE\":\"通用10号褐牛纸袋\",\"FOURTH_LEVEL_CONVERSION_RATIO\":null,\"GOODS_SUBCLASS\":\"303\",\"FIFTH_LEVEL_FROM_UNIT\":\"E9\",\"GOODS_SUBCLASS_NAME\":\"303-袋子类\",\"FOURTH_LEVEL_FROM_UNIT\":null,\"FIFTH_LEVEL_TO_UNIT\":\"CC\",\"QUOTING_UNIT\":\"CA\",\"PUR_MEASURING_UNIT\":\"CA\",\"ITEM_NAME_IN_ENGLISH\":null,\"PACKING_SPECIFICATION\":\"250只*4袋*1箱\",\"THIRD_LEVEL_TO_UNIT\":null,\"SECOND_LEVEL_FROM_UNIT\":\"BC\",\"GENERAL_LEDGER_CATEGORY_CODE\":\"KFC\",\"FIRST_LEVEL_TO_UNIT\":\"BC\",\"STATUS_IN_BOM\":\"ACTIVE\",\"SHORT_PROJECT_NUMBER\":\"86130454\",\"HEC_SHELF_LIFE_BANNED_SALE\":null,\"FIRST_LEVEL_CONVERSION_RATIO\":4.0000000,\"ITEM_CREATED_BY\":\"ADMIN(期初导入)\",\"ITEM_CATEGORY\":\"Z\",\"SECOND_LEVEL_CONVERSION_RATIO\":250.0000000,\"HEC_YUM_LOWEST_AP\":null,\"WHETHER_HAVE_AP_TABLE\":\"Y\",\"DEVANNING_FROM_UNIT\":null,\"FIFTH_LEVEL_CONVERSION_RATIO\":52.5600000,\"SIXTH_LEVEL_FROM_UNIT\":\"E9\",\"DEVANNING_TO_UNIT_NEW\":\"E9\",\"REGULAR_EDITION_EFFECTIVE_DATE\":null,\"ITEM_LAST_UPDATED_BY\":\"管理员\",\"SECOND_LEVEL_TO_UNIT\":\"E9\",\"LS_DELIVERY_METHOD\":null,\"MASTER_PLANNER\":\"-\",\"JDE_ITEM_NAME\":\"通用10号褐牛纸袋-250只*4袋/箱\",\"WHETHER_REGULAR_EDITION\":\"N\",\"HEC_BAR_CODE\":null,\"WHETHER_LONGTIME_DEVANNING\":\"N\",\"HEC_SHELF_LIFE\":null,\"LC_SHELF_LIFE\":null,\"BRAND_NAME\":null,\"FIRST_LEVEL_FROM_UNIT\":\"CA\",\"ITEM_CREATION_DATE\":\"2013-05-21 00:00:00\",\"STATE_TAX_COMMODITY_CODE\":\"1060105010000000000\",\"WHETHER_FRAGILE\":null,\"DEVANNING_FROM_UNIT_NEW\":\"CA\",\"JDE_RELATED_EQA_CODE\":\"SKU0001843\",\"THIRD_LEVEL_CONVERSION_RATIO\":null,\"MEASURED_GROSS_WEIGHT\":13.2000000,\"JDE_RELATED_EQA_SUBCODE\":\"SKU0001843-1\",\"DEVANNING_TO_UNIT\":null},\"brand\":[{\"ITEM_JDE_CODE\":\"86130954\",\"BRAND_CODE\":\"KFC\",\"BRAND_STATUS\":\"FROZEN\"},{\"ITEM_JDE_CODE\":\"86130954\",\"BRAND_CODE\":\"ED\",\"BRAND_STATUS\":\"ACTIVE\"}],\"acceptable_period\":{\"AP_BRAND_CODE\":\"KFC\",\"AP_DELIVERY_UNIT\":\"CA\",\"AP_PACKING_SPEC\":\"250只*4袋*1箱\",\"AP_RESTAURANT\":30,\"AP_OPERABILITY\":\"Y\",\"AP_YLC_PRINCIPAL\":null,\"AP_JDE_PRODUCT_NAME\":\"通用10号褐牛纸袋\",\"AP_LC_ALLOCATION\":15,\"AP_SHELF_LIFE\":730,\"AP_INTEGRATION_CENTER\":15,\"AP_VENDOR_TURNOVER_DAYS\":365,\"AP_LC_DELIVERY_DAYS\":9,\"ITEM_JDE_CODE\":\"86130954\",\"AP_LC_INVENTORY_DAYS\":30,\"AP_RE_PRINCIPAL\":null,\"AP_LC_REMAINING_ADJUSTABLE_DAYS\":266,\"AP_ATTRIBUTES\":\"A\",\"AP_LC\":365,\"AP_SCM_PRINCIPAL\":null,\"AP_YUM\":365},\"promotion\":{\"PROMOTION_MKT_COUNTERPART\":null,\"PROMOTION_REMARKS\":null,\"IP_AUTHORIZATION_END_DATE\":null,\"ITEM_JDE_CODE\":\"86130954\",\"PROMOTION_END_DATE\":null,\"BRAND_CODE\":null,\"PROMOTION_START_DATE\":null,\"PROMOTION_OFFICIAL_NAME\":null,\"PROMOTION_MKT_APPLICANT\":null,\"PROMOTION_NATURE\":null,\"PROMOTION_MKT_MAIL\":null,\"JDE_ITEM_NAME\":\"通用10号褐牛纸袋-250只*4袋/箱\"}}]}");
        return list.get(3);
    }

}
